package com.theo.mapper;

import com.theo.entity.HospitalInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 方涛
 * @since 2021-02-02
 */
@Repository
public interface HospitalInfoMapper extends BaseMapper<HospitalInfo> {

    int saveHospitalInfo(HospitalInfo hospitalInfo);

    int deleteHospitalInfo(Integer id);

    int updateHospitalInfo(Integer id);

    @Select("SELECT h.`hospital_id`,h.`hospital_name`, h.`address`,h.`is_sentinel`,h.`is_fever`,h.`status`,h.`is_core`,h.`city_id`,c.`city_name`\n" +
            "FROM `hospital_info` h INNER JOIN `city_info` c\n" +
            "ON h.`city_id`=c.`city_id`")
    List<HospitalInfo> queryAllHospitalInfo();

    HospitalInfo queryHospitalInfoById(Integer id);

    List<HospitalInfo> queryHospitalInfoByCityId(Map<String,Object> map);

}
